<?php
class BasejfPersonalizationActions extends sfActions
{
  public function executeUpdatePage(sfWebRequest $request)
  {
		$this->setLayout(false);
  	$this->getResponse()->setContentType('application/javascript');
  	$request->setRequestFormat('html'); //we do not want to use template files ending on .js.php
  	$this->handlers = $request->getParameter('handlers');
    
  	$whitelist = sfConfig::get('app_gujPersonalization_whitelist', array());
  	foreach ($this->handlers as $handler) {
  		if (!array_key_exists($handler['module'], $whitelist) || false === array_search($handler['component'], $whitelist[$handler['module']])) {
  			throw new jfPersonalizationSecurityException('Component '.$handler['module'].'/'.$handler['component'].' is not whitelisted.');
  		}
  	}
    
  }
  
}